<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="bp" value="${pageContext.request.contextPath}" scope="session"></c:set>
<html>
<head>
    <title>jstl标签的使用</title>
    <script type="text/javascript" src="${bp}/js/jquery-1.11.1.js"></script>
</head>
<body>

<%--<c:if test="${1>2}"><button>普通按钮1</button></c:if>--%>
<%--<c:if test="${1<2}"><button>普通按钮2</button></c:if>--%>

<%--<c:forEach var="student" items="${students}" >--%>
<%--  --%>
<%--</c:forEach>--%>

<table border="1px" cellspacing="0" width="100%">
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>分数</th>
        <th>性别</th>
        <th>生日</th>
    </tr>
  <c:forEach items="${students}" var="student">
      <tr>
          <td>${student.id}</td>
          <td>${student.stuName}</td>
          <td>${student.age}</td>
          <td>${student.score}</td>
          <td>${student.sex}</td>
          <td><fmt:formatDate value="${student.birth}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
      </tr>
  </c:forEach>

</table>
<c:choose>
    <c:when test="${1>2}"><button>按钮1</button></c:when>
    <c:when test="${1>2}"><button>按钮2</button></c:when>
    <c:otherwise><button>按钮3</button></c:otherwise>
</c:choose>
</body>
</html>
